<%@ page pageEncoding="UTF-8"%>
<%@ include file="../commons/head.jsp"%>
<title>合同二审</title>
<style type="text/css">
	.button{width: 100px;height: 30px;margin:3px 20px 3px 0;padding-top: 3px;}
	*{font-size: 14px;}
	.th td{font-weight: 700;}
	/* label{margin: 0 10px 0 18px;font-weight: 500;height: 25px;line-height: 25px;} */
     .control-label{padding: 0;font-weight: bold;}
     .diaform{margin: 20px auto;}
     h3{border-bottom:1px solid #ddd;padding-bottom:5px;width: 98%;  }
     .datagrid-view{border-top:1px solid #ddd;margin-top: 8px;}
     .datagrid-pager{border-bottom:1px solid #ccc;}
     hr{margin:15px 0 13px 0 ;background-color: #ddd;height: 1px;border: 0; width: 120%;}
     .jianju{margin-left:15px; }
     .datagrid-htable{
     font-weight:bold;
	/* background-color: #148CCA; */
	}
	.demo_line_01{
    
    margin: 5px 0;
    font-size: 50px;
    line-height: 1px;
    text-align: center;
	}
	.demo_line_01 .line{
	display:inline-block;
	   width:47.8%;
	   height:1px;
	   background:#ddd;
	   vertical-align:middle;
	   margin-top:8px;
	}
	.container-fluid{
	padding-left: 15px;
	}
	.datagrid-ftable td div{
		font-size: larger;
	
	}
	#pulldown{
		margin-top: 20px;
	}
	
/* td.datagrid-header-over{
	background: #148CCA !important;
} */
</style>
<title>合同二审</title>
<style>
.datagrid-body {
height:320px !important;
}
.datagrid-view {
height:350px !important;
}

</style>
<script type="text/javascript">
var isValid;
var helpType;
var data;
var flag=0;
var del=0;
$(function(){
		//查询
		$("#search").click(function(){
			var params = {
				cellphone:$("#cellphone").val(),
				userName:$("#userName").val(),
				recom:$("#recom").val(),
				companyName:$("#companyName").combobox("getValue"),
			};
			$("#tt").datagrid("unselectAll");
		$("#tt").datagrid('load',params);
		});
		//导出
		$("#export").click(function(){
			var params = {
					cellphone:$("#cellphone").val(),
					userName:$("#userName").val(),
					recom:$("#recom").val(),
					companyName:$("#companyName").combobox("getValue"),
			};
	 		window.location.href="${pageContext.request.contextPath}/secContract/export?cellphone="+params.cellphone
					+"&userName="+params.userName
					+"&recom="+params.recom
					+"&companyName="+params.companyName
					; 
		});
	});
	


//合同状态
function showStatus(value, row, index) {
	var content = '';
	console.log(value);
	//10：逾期中 20：执行中 30：待二审 40：待一审 50：录入中 60：待放款
	if(value=='10'){
		content = '逾期中'
	}else if(value=='20'){
		content = '执行中'
	}else if(value=='30'){
		content = '待二审'
	}else if(value=='40'){
		content = '待一审'
	}else if(value=='50'){
		content = '录入中'
	}else if(value=='60'){
		content = '待放款'
	}
	  return content;
}

//鼠标悬停显示提示
function showTips(value, row, index) {
	var content = '';
	if(value != null && value != '' || value == 0){
	    content = '<span title="' + value + '" class="note" >' + value + '</span>';
	}
    return content;
}
//执行详情
function showXQ(value, row, index) {
	
	
	var content = '';
	if(true){
		content = '<a href="${ctx}/secContract/firContractExe?id='+row.id+'">执行详情</a>';
	}
	return content;  
}

function rowStyle(index,row){
	if (index%2==0){     
        return 'background-color:lightcyan;';     
    }     
}

</script>
</head>
<body>

<div class="jianju">
<h3>合同二审</h3>
<div id="tb" style="height:auto">
	<hr/>
	<div>
<label style="margin-left:0;">客户手机：</label><input id="cellphone" class="easyui-textbox" style="width:15%">
<label style="margin-left:15px;">客户姓名：</label><input id="userName" class="easyui-textbox" style="width:15%">
<label style="margin-left:15px;">所属公司：</label><select id="companyName"  class="easyui-combobox" style="width:15%" 
				url="${pageContext.request.contextPath }/firContract/findCompany"
				valueField="id" textField="companyName" method="get" editable="false"
				panelHeight="auto">
		</select>
<label style="margin-left:15px;">推荐人：</label><input id="recom" class="easyui-textbox" style="width:15%"><br><br>
<a id="search" href="#" class="easyui-linkbutton button" style="margin-left:15px;" iconCls="icon-search">查询</a>	
<a id="export" href="#" class="easyui-linkbutton button" style="margin-left:15px;" iconCls="icon-search">导出</a>
</div>
</div>
	<table id="tt" class="easyui-datagrid" 
		url="${pageContext.request.contextPath }/secContract/list" 
		title="" style="width:98%;minWidth:1000px;" iconCls="icon-save"
		rownumbers="true" pagination="true"
		pageList="[10,20,30,40]" method="get"
		toolbar="#tb" singleSelect="true"
		fitColumns="true" idField="id" rowStyler="rowStyle" >
		<thead>
			<tr>
				<th data-options="field:'id',align:'center',formatter:showTips" style="width:10%">合同编号</th>
				 <th data-options="field:'userName',align:'center',formatter:showTips" style="width:10%">客户姓名</th>
				<th data-options="field:'companyName',align:'center',formatter:showTips" style="width:10%">所属公司</th>
				<th data-options="field:'cellphone',align:'center',formatter:showTips" style="width:10%">客户手机</th>
				<th data-options="field:'exceptAmount',align:'center',formatter:showTips" style="width:10%">拟借金额</th>
				<th data-options="field:'appDateStr',align:'center',formatter:showTips" style="width:10%">申请日期</th>
				<th data-options="field:'cyc',align:'center',formatter:showTips" style="width:10%">服务期数</th>
				<th data-options="field:'status',align:'center',formatter:showStatus " style="width:10%">合同状态</th>
				<th data-options="field:'null',align:'center',formatter:showXQ" style="width:10%">操作</th>  
 			</tr>
		</thead>
	</table>
</div>


</body>

</html>